package feizhou.consumerdemo.business.feign;

import feizhou.consumerdemo.business.config.FeignLoggerConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import feizhou.consumerdemo.business.bean.User;
import feizhou.consumerdemo.business.feign.fallback.UserFeignFallback;

//声明当前类是一个Feign客户端，指定服务名为user-service
@FeignClient(value = "user-service", fallback = UserFeignFallback.class,configuration = FeignLoggerConfig.class)
public interface UserFeign {
    
    // http://user-service/user/1
    @GetMapping("/user/{id}")
    User queryById(@PathVariable("id") Long id);
}
